#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
ll a[100010];
int main()
{
	IOS;
	int n,c1,c2;
	cin>>n>>c1>>c2;
		string s;
		int ans=3*n*min(c1,c2);
		int sum=0;
		for(int i=1;i<=n;i++)
		{
			vector<int> v(30,0);
			cin>>s;
			int f=0;
			for(auto j:s)
			{
				v[j-'A']++;
				if(v[j-'A']>=2)
				{
					f=1;
					break;
				}
			}
			if(f) sum+=min(c2+min(c1,c2),3*min(c1,c2));
			else sum+=3*min(c1,c2);
		}
		cout<<min(sum,ans);

	return 0;
}
